#ifndef __LIB_KERNEL_VIRTUAL_PIC8259A_H
#define __LIB_KERNEL_VIRTUAL_PIC8259A_H
#include "stdint.h"                 //我们的stdint.h中定义了数据类型，包含进来
#include "global.h"

struct PIC8259A {
    unsigned char imr;
    unsigned char irr;
    unsigned char isr;
    unsigned char icw[4];
    unsigned char ocw[3];
    struct PIC8259A* slave;
};

void PIC_INIT(struct PIC8259A* pic);
void PIC_writeICW(struct PIC8259A* pic, int icw_index, unsigned char value);
void PIC_writeOCW(struct PIC8259A* pic, int ocw_index, unsigned char value);

bool IS_BIT_SET(unsigned char data, int bit_position);
void SET_BIT(unsigned char data, int bit_position);
void CLEAR_BIT(struct PIC8259A* pic, int bit_position);

int PIC_PR(struct PIC8259A* pic);


#endif
